package com.min.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Test01 {
    public static void main(String[] args) {
        Student s1 = new Student(1, "minqike", 30, "M");
        Student s2 = new Student(2, "hanhuiqiao", 32, "F");
        Student s3 = new Student(3, "shizhui", 40, "M");

        List<Student> list = Arrays.asList(s1, s2, s3);

        List<Student> fiteredList = list.stream()
                .filter(student -> student.getAge() > 30 && student.getSex().equals("M"))
                .collect(Collectors.toList());

        System.out.println(fiteredList);
    }
}
